package com.example.purplestarcb.shoujizhushou;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Setup4Activity extends BaseSetupActivity {

    private SharedPreferences sp;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        sp = getSharedPreferences("config", MODE_PRIVATE);
        setContentView(R.layout.activity_setup4);
        Button button = (Button) findViewById(R.id.succeed);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SharedPreferences.Editor editor=sp.edit();
                editor.putBoolean("configed",true);
                editor.apply();
                Intent intent = new Intent(Setup4Activity.this, LostFindActivity.class);
                startActivity(intent);
                // 关闭当前的界面。
                finish();
                overridePendingTransition(R.anim.tran_in, R.anim.tran_out);
            }
        });

    }

    @Override
    public void showNext() {


    }

    @Override
    public void showPre() {
        Intent intent = new Intent(this,Setup3Activity.class);
        startActivity(intent);
        finish();
        //要求在finish()或者startActivity(intent);后面执行；
        overridePendingTransition(R.anim.tran_pre_in, R.anim.tran_pre_out);
    }
}
